//
//  ipv4_parser.h
//  testpcap
//
//  Created by bugforever on 1/14/15.
//  Copyright (c) 2015 bugforever. All rights reserved.
//

#ifndef __ipv4_parser_h
#define __ipv4_parser_h

#include "../../Include/network_struct.h"

struct ipv4_data
{
    int version;
    
    int header_length;
    int total_length;
    
    int identification;
    
    bool will_fragment;
    bool is_last_fragment;
    
    int fragment_offset;
    
    int ttl;
    int protocol;
    
    u_char saddr[4];
    u_char daddr[4];
    
    interface_network_data * ptr_data;
};

class ipv4_parser
{
public:
    ipv4_parser();
    virtual ~ipv4_parser();
    
    virtual ipv4_data * parse(  network_ethernet_data * ptr_ethernet_data );
    
private:
    ipv4_data m_ipv4;
};

#endif /* defined(__testpcap__ipv4_parser__) */
